<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>结算</title>
    <script type='text/javascript' src='__PUBLIC__/home/js/jquery.js'></script>

    <meta name="Keywords" content="书">
    <link href="__PUBLIC__/home/css/public.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/yg.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/order.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/themes.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/jquery-ui.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/msgbox.css" rel="stylesheet" type="text/css">
    <style> 
          input{
                width:370px;
                height:30px;
                margin-top:10px;
          }
          textarea{
                margin-top:10px;
          }
            
            
            
        </style>
   
</head>
<body id="body" class="modal-open">
    <div class="w w1280">


<!------- 顶部工具栏 ------>
<div class="site-nav">
    <div class="wrap">
        <ul class="fl">
            <li>欢迎光临！</li>
                </ul>

                <ul class="fr">

                    <li class="mobile">
                        <div class="tit"><a href="__MODULE__/Index/index">首页<s></s></a></div>
                        
                    </li>
                    
                    <if condition="$V=SESSION('username')">
                    <li id="" style="">
                        <a rel="nofollow" href="__MODULE__/Collect/index">我的收藏</a>
                    </li>
                    <li id="" style="">
                        <a rel="nofollow" href="__MODULE__/User/index">会员中心</a>
                    </li>
                    <li id="" style="">
                        <a rel="nofollow" href="__MODULE__/Cart/index/goodsNum/1">去购物车</a>
                    </li>
                    <li id="_logout" style="">
                        <a href="__MODULE__/Login/logout" class="logout">[退出]</a>
                    </li>
                    <li id="" style="">
                        <a rel="nofollow"><{$V}></a>
                    </li>
                    <else/>
                    <li id="_register" style="">
                        <a rel="nofollow" href="__MODULE__/Register/index">[注册]</a>
                    </li>
                    <li id="_login" style="">
                        <a rel="nofollow" href="__MODULE__/Login/index">[登录]</a>
                    </li>
                    
                    </if>
                </ul>
            </div>
        </div>

        <!------- 头部 ------>
        <div class="header clearfix">
            <div class="wrap">
                <div class="logo">
                    <a></a>
                    
                </div>
                
                <div class="steps">
                    <ul>
                        <li class="on"><b class="b1"></b><span>我的购物车</span></li>
                        <li class="on"><i></i><b class="b2"></b><span>确认订单信息</span></li>
                        <li><i></i><b class="b3"></b><span>成功提交订单</span></li>
                    </ul>
                </div>
            </div>
        </div>
        


<div class="order">
    <form action="__MODULE__/orderover/add" method="post" onsubmit="return fun()">
    <div class="wrap">
        <h2>填写核对订单信息</h2>
        <div class="order-alert">
            <!--收货信息-->
            <div id="order1" class="order-mode complete">
                <h3><i class="o-i-receive"></i>收货信息</h3>
                <a class="backcart" href="__MODULE__/cart/index/goodsNum/1">返回购物车 >> </a>

                <!-- 收货地址 -->
                <div class="o-receive">
                
                    <div>

                        <!-- ----------------------------------------------------------------------- -->
                            <table style="color:green">
                                <tr>
                                    <td>收件人姓名：</td>
                                    <td><input type="text" name="linkman" value=""></td>
                                </tr>
                                <tr>
                                    <td>收货地址：</td>
                                    <td><textarea rows="3" cols="56" class="t_input recipient_street" style="height:auto;resize:none;" id="address" name="address"></textarea></td>
                                </tr>
                                <tr>
                                    <td>Email：</td>
                                    <td><input type="text" name="email" value=""></td>
                                </tr>
                                <tr>
                                    <td>邮编：</td>
                                    <td><input type="text" name="code" value=""></td>
                                </tr>
                                <tr>
                                    <td>手机号：</td>
                                    <td><input type="text" name="mobile" value=""></td>
                                </tr>
                                <tr>
                                    <td><input type="hidden" name="totalall" value="<{$totalall}>"></td>
                                </tr>
                                <tr>
                                    <td><input type="hidden" name="ids" value="<{$ids}>"></td>
                                </tr>
                                <tr>
                                    <td><input type="hidden" name="state" value="已下单"></td>
                                </tr>
                                <tr>
                                    <td><input type="hidden" name="order_number" value="<{$ordernumber}>"></td>
                                </tr>
                                <tr>
                                    <td><input type="hidden" name="addtime" value="<{$addtime}>"></td>
                                </tr>
                            </table>
                            
                        
                        <!-- ----------------------------------------------------------------------- -->
                    </div>

                </div>
                <!-- 收货地址 -->

            </div>

      
            <!--商品信息-->
            <div id="order5" class="order-mode">
                <h3>
                    <i class="o-i-commodity"></i>商品信息
                    
                </h3>
                <div class="o-commodity">


<table class="table">
    <thead>
        <tr>
            <th>商品图片</th>
            <th>商品名称</th>
            <th>单价</th>
            <th>数量</th>

            <th>金额小计</th>
        </tr>
    </thead>
    <tbody>
        <foreach name='mycart' item='mycart'>
            <tr>
                <td>
                    <img style="width:100px;height:100px;" src="__PUBLIC__/Upload/<{$mycart.goodspic}>">
                </td>
                <td><{$mycart.goodsname}></td>
                <td>￥<{$mycart.goodsprice}></td>
                <td><{$mycart.number}></td>

                <td>￥<{$mycart.xiaoji}></td>
            </tr>
        </foreach>
           
    </tbody>
    
</table> 
            <tr>
                <span style="color:green">买家留言：</span>
                <td><input type="text" name='speak' placeholder="请输入您的留言"></td>
            </tr>


                    
                </div> 
            </div>
            
            
           
            <div id="order71" class="cart-footer clearfix settle settle-fixed">
                <div class="wrap">
                    <div class="right">
                        <span class="none">运费：<em>￥</em><em>10.00</em>元</span>
                        <span class="none">商品金额：<em>￥</em><em><{$total}></em>元</span>
                        <span class="fs14">应付款：<em>￥</em><em><{$totalall}></em></span>
                        <button id="btnOrderSubmit" class="btn" style="background-color: rgb(255, 83, 23);">提交订单</button>
                    </div>
                </div>
              </div>
            </form>
           
        </div>
    </div>
</div>
    <include file="./Public/footer.html" />

<div style="height:60px;"></div>

<div class="modal-backdrop fade in"></div>
</body>
   <script type="text/javascript">
               var linkman=true;
               var address=true;
               var mobile=true;
               var code=true;
               var email=true;
   //用户名
             $('input[name="linkman"]').bind('focus',function(){
                $(this).attr("placeholder","");
            })
             $('input[name="linkman"]').bind('blur',function(){
                if($(this).val() == ''){
                    $(this).attr('placeholder','请输入用户名');
                    re_name = false;
                }
                if($(this).val()!=''){
                    var p2=/^[\u4e00-\u9fa5]{2,4}$/;
                    var s2=$(this).val();
                    if(!p2.test(s2)){
                        alert('输入用户格式错误');
                        linkman = false;
                    }
                }  
            })
   //收货地址
             $('textarea').bind('focus',function(){
                $(this).attr("placeholder","");
                // alert(1)
            })
             $('textarea').bind('blur',function(){
                if($(this).val() == ''){
                    $(this).attr('placeholder','请输入详细地址， 前三个必须为汉字，长度大于3个');
                    address=false;
                }
                if($(this).val()!=''){
                    var p1=/^[\u4e00-\u9fa5]{3,20}\w{0,10}/;
                    var s1=$(this).val();
                    if(!p1.test(s1)){
                        alert('地址格式错误');
                        address=false;
                    }else{
                        address=true;
                    }
                }  
            })
        //手机号
            $('input[name="mobile"]').bind('focus',function(){
                $(this).attr("placeholder","");
                // alert(1)
            })
            $('input[name="mobile"]').bind('blur',function(){
                if($(this).val() == ''){
                    $(this).attr('placeholder','请输入手机号');
                    mobile=false;
                }
                var p=/^1\d{10}$/;
                var s=$(this).val();
                if(!p.test(s)&& s!=''){
                  alert('手机号码格式错误，请输入以1开头并且11位数字的电话号码')
                  mobile= false;
                }else{
                  mobile= true;
                }
            })
             //邮编
              $('input[name="code"]').bind('focus',function(){
                $(this).attr("placeholder","");
            })
             $('input[name="code"]').bind('blur',function(){
                if($(this).val() == ''){
                    $(this).attr('placeholder','请输入邮政编码');
                    re_name = false;
                }
                if($(this).val()!=''){
                    var p3=/^[1-9]\d{5}$/;
                    var s3=$(this).val();
                    if(!p3.test(s3)){
                        alert('输入邮政编码格式错误');
                        linkman = false;
                    }
                }  
            })
           //邮箱
             $('input[name="email"]').bind('focus',function(){
                $(this).attr("placeholder","");
            })
             $('input[name="email"]').bind('blur',function(){
                if($(this).val() == ''){
                    $(this).attr('placeholder','请输入邮箱');
                    email= false;
                }
                if($(this).val()!=''){
                    var p4=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
                    var s4=$(this).val();
                    if(!p4.test(s4)){
                        alert('输入邮箱格式错误');
                        email = false;
                    }
                }  
            })


            // 绑定表单提交事件
            $('button').bind('click',function(){
                //判断用户名
                var p2=/^[\u4e00-\u9fa5]{2,4}$/;
                var s2=$('input[name="linkman"]').val();
                if(!p2.test(s2) && s2 != ''){
                    alert('输入用户格式错误');
                    linkman= false;
                }else if(s2 == ''){
                    $('input[name="linkman"]').attr('placeholder','请输入收货人姓名');
                    linkman = false;
                }else{
                    linkman = true;
                }
               
                //判断地址
                if($('textarea').val() == ''){
                    $('textarea').attr('placeholder','请输入详细地址');
                    address = false;
                }else if($('textarea').val() != ''){
                    //判断输入的地址格式是否正确
                    var p5=/^[\u4e00-\u9fa5]{3,20}\w{0,10}/;
                    var s5=$('textarea').val();
                    if(!p5.test(s5)){
                        alert('地址格式错误');
                        address=false;
                    }else{
                        address=true;
                    }
                }
                //判断手机
                var p=/^1\d{10}$/;
                var s=$('input[name="mobile"]').val();
                if(!p.test(s)&& s!=''){
                    alert('手机号码格式错误，请输入以1开头并且11位数字的电话号码')
                    mobile= false;
                }else if(s == ''){
                    $('input[name="mobile"]').attr('placeholder','请输入手机号');
                    mobile= false;
                }else{
                    mobile= true;
                }

              //判断邮箱
              var p4=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
              var s4=$('input[name="email"]').val();
              if(!p4.test(s4)&& s4!=''){
                alert('邮箱格式错误,请输入正确邮箱');
                email=false;
              }else if(s4==''){
                $('input[name="email"]').attr('placeholder','请输入邮箱');
                  email=false;
              }else{
                  email=true;
              }

           //判断邮政编码
              var p3=/^[1-9]\d{5}$/;
              var s3=$('input[name="code"]').val();
              if(!p3.test(s3)&& s3!=''){
                alert('邮政编码格式错误,请输入正确邮编');
                code=false;
              }else if(s3==''){
                $('input[name="email"]').attr('placeholder','请输入邮政编码');
                  code=false;
              }else{
                  code=true;
              }

                if(linkman && address && mobile && email && code){
                    return true;
                }else{
                    return false;
                }

           })
    

             
        


   </script>

</html>